/**
 * 组件：ImageButton 图片按钮组件
 * Author:Colin3dmax
 */
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {
    StyleSheet,
    View,
    Text,
    TextInput,
    Image,
    TouchableOpacity,
} from 'react-native';

class VoiceBox extends Component {

    static propTypes = {
        title: PropTypes.string,
        style: View.propTypes.style,
        touchStyle:View.propTypes.style,
        textStyle: View.propTypes.style,
        onPress: PropTypes.func,
    }

    static defaultProps = {
        title: '按住 说话'
    }

    constructor(props) {
        super(props)
        this.state = {}
    }

    componentDidMount() {

    }

    render() {
        const {title, touchStyle,style, textStyle, onPress} = this.props
        return (
            <TouchableOpacity style={[styles.voiceBoxTouch, touchStyle]} onPress={onPress}>
                <View style={[styles.voiceBox, style]}>
                    <Text style={[styles.inputText, textStyle]}>{title}</Text>
                </View>
            </TouchableOpacity>
        );
    }
}

const styles = StyleSheet.create({
    voiceBoxTouch:{
        flex: 1,
    },
    voiceBox: {
        flex: 1,
        borderWidth: 1,
        borderColor: '#C0C2C6',
        borderRadius: 3,
        backgroundColor: '#F5F5F7',
        justifyContent: 'center',
        alignItems:'center',
        paddingLeft: 5,
        paddingRight: 5,
        minHeight: 32,
    },
    inputText: {
        fontSize: 14,
        fontWeight:'900',
        color:'#565656',
    },
});

export default VoiceBox;